package com.sunny.wordstudy.lib;

import android.media.MediaPlayer;
import com.sunny.wordstudy.StudyView;
import java.io.File;
import java.io.PrintStream;

public class Study
{
  public static final int CST_REMEMBERFOREVER = 2;
  public static final int CST_TESTDONE = 1;
  public static final int IST_INPUTFAIL = 2;
  public static final int IST_INPUTNONE = 0;
  public static final int IST_INPUTOK = 1;
  public static final int IST_INPUTRETRY = 3;
  public static final int WST_DEALING = 2;
  public static final int WST_LOADING = 3;
  public static final int WST_SAVING = 1;
  public static final int WS_AUTOSOUND_CHOOSE = 2;
  public static final int WS_AUTOSOUND_NEW = 1;
  public static final int WS_AUTOSOUND_NONE = 0;
  public static final int WS_RECALLSTUDY_DEFAULT = 0;
  public static final int WS_RECALLSTUDY_ONLYONFAIL = 1;
  private static Study iStudy = new Study();
  private MediaPlayer mp = null;
  private StudyView view;

  static
  {
    iStudy.doInit();
  }

  public static Study getInstance()
  {
    return iStudy;
  }

  public native void BeginSession(int paramInt);

  public void CancelWait(int paramInt)
  {
    this.view.cancelWait(paramInt);
  }

  public void CheckRegInfo(int paramInt)
  {
    this.view.checkRegInfo(paramInt);
  }

  public native void ChooseAns(int paramInt);

  public native boolean DealKeyPress(int paramInt);

  public boolean DoInputWord(String paramString1, String paramString2)
  {
    return this.view.DoInputWord(paramString1, paramString2);
  }

  public native void EndSession();

  public void FinishStudy()
  {
    this.view.finish();
  }

  public native void InputWord();

  public native void NextWord(boolean paramBoolean);

  public void PlaySound()
  {
    File localFile1 = new File("/sdcard/wordstudy/");
    if (!(localFile1.exists()))
      localFile1.mkdirs();
    File localFile2 = new File("/sdcard/wordstudy/" + "word.wav");
    if ((localFile2.exists()) && (localFile2.length() > 512L));
    try
    {
      this.mp.reset();
      this.mp.setDataSource("/sdcard/wordstudy/" + "word.wav");
      this.mp.prepare();
      this.mp.start();
      this.mp.setOnCompletionListener(new 1(this));
      return;
    }
    catch (Exception localException)
    {
      String str = localException.getMessage();
      System.err.print("Play Sound Err: " + str);
    }
  }

  public void ReformShowDataInfo()
  {
    this.view.ReformDataInfo();
  }

  public native void SecondStep(int paramInt, String paramString);

  public native void SetShowStat(int paramInt);

  public int ShowConfirm(int paramInt)
  {
    return this.view.ShowConfirm(paramInt);
  }

  public int ShowInputResult(int paramInt)
  {
    return this.view.ShowInputResult(paramInt);
  }

  public int ShowWait(int paramInt)
  {
    return this.view.showWait(paramInt);
  }

  public void StopSound()
  {
    try
    {
      this.mp.reset();
      return;
    }
    catch (Exception localException)
    {
      System.err.print("Stop Sound Err: " + localException.getMessage());
    }
  }

  public native void WordKnow(boolean paramBoolean);

  public native void WordOk(boolean paramBoolean);

  public native void doDeinit();

  public native void doInit();

  public native int getAutoSound();

  public native int getRecallStudy();

  public StudyView getView()
  {
    return this.view;
  }

  public native int getWordStatus();

  public native boolean isInAction();

  public native boolean isResponsed();

  public native boolean isShowAns();

  public native boolean isShowRel();

  public native boolean isShowSample();

  public native boolean isShowStatus();

  public native void setAutoSound(int paramInt);

  public native void setInAction(boolean paramBoolean);

  public native void setRecallStudy(int paramInt);

  public native void setResponsed(boolean paramBoolean);

  public native void setShowAns(boolean paramBoolean);

  public native void setShowRel(boolean paramBoolean);

  public native void setShowSample(boolean paramBoolean);

  public native void setShowStatus(boolean paramBoolean);

  public void setView(StudyView paramStudyView)
  {
    this.view = paramStudyView;
    if (this.mp != null)
      return;
    this.mp = new MediaPlayer();
  }

  public native void setWordStatus(int paramInt);
}

/* Location:           E:\Desktop\Android\yanguangbeidanci\classes_dex2jar.jar
 * Qualified Name:     com.sunny.wordstudy.lib.Study
 * JD-Core Version:    0.5.3
 */